package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiD_proxy;

//DAO
public interface D_proxyMapperBase {

	// 根据id查看
	@Select("SELECT * FROM d_proxy  WHERE PROXYID = #{proxyid}")
	public ApiD_proxy findD_proxyById(Integer proxyid);

	// 查看数据集
	@Select("SELECT * FROM D_proxy")
	public List<ApiD_proxy> findD_proxys();

	// 根据条件查看数据集
	public List<Map<String, Object>> findD_proxysByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO d_proxy (PROXYNAME, DEPOSIT, DESCRIPTION, RECOMMENDSAMEPERCENT, RECOMMENDUPPERCENT, MONTHTARGETMONEY, REPLENISHPERCENT, MINRECHARGEMONEY, REPLENISHPERCENT2, IS_SAME_FIRST, IS_UP_FIRST, RECOMMENDSAMEPERCENT2) VALUES (#{proxyname}, #{deposit}, #{description}, #{recommendsamepercent}, #{recommenduppercent}, #{monthtargetmoney}, #{replenishpercent}, #{minrechargemoney}, #{replenishpercent2}, #{is_same_first}, #{is_up_first}, #{recommendsamepercent2})")
	@Options(useGeneratedKeys = true, keyProperty = "proxyid")
	public int insertD_proxy(ApiD_proxy d_proxy);

	// 修改
	@Update("UPDATE d_proxy SET PROXYNAME = #{proxyname}, DEPOSIT = #{deposit}, DESCRIPTION = #{description}, RECOMMENDSAMEPERCENT = #{recommendsamepercent}, RECOMMENDUPPERCENT = #{recommenduppercent}, MONTHTARGETMONEY = #{monthtargetmoney}, REPLENISHPERCENT = #{replenishpercent}, MINRECHARGEMONEY = #{minrechargemoney}, REPLENISHPERCENT2 = #{replenishpercent2}, IS_SAME_FIRST = #{is_same_first}, IS_UP_FIRST = #{is_up_first}, RECOMMENDSAMEPERCENT2 = #{recommendsamepercent2} WHERE PROXYID = #{proxyid}")
	public int updateD_proxy(ApiD_proxy d_proxy);

	// 删除
	@Delete("DELETE FROM d_proxy  WHERE PROXYID = #{proxyid}")
	public int deleteD_proxy(Integer proxyid);

	// Foreign keys revelant

	// region Indexs revelant

}
